<?php
$public = true;
if (!isset($common)) require_once 'include/common.php';
require_once 'index.functions.inc.php';
?>

<?php include 'ui/header.php'; ?>
<title>the tims</title>
<link rel="stylesheet" type="text/css" href="ui/index.css" />

<?php include 'ui/body_index.php'; ?>
<table>
	<tr>
		<td width=55% style="vertical-align:top">
			<p><a href="createdb.php">Inicializar BD</a></p>
			<p><a href="cookiewatch.php">Ver cookie</a></p>
			<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
			
			<table width="100%">
				<tr>
					<td>
						<?php show_carrousel(); ?>
					</td>
					<td valign="bottom" align="right">
						<?php show_player(); ?>
					</td>
				</tr>
			</table>
		</td>
		
		<td width=25% style="vertical-align:top">
			<div class="box">
				<h1><?php p('statistics'); ?></h1>
				<h2><?php p('time_online'); ?>:</h2>
				<p>
					<!--  days -->
					<?php
						$seconds = stats("online_time");
						$days = floor($seconds/86400);
						echo $days.' '.m('days');
						
						$seconds = $seconds - $days*86400;
						$hours = floor($seconds/3600);
						echo ' | '.$hours.' '.m('hours');;
					?>					
				</p>
				<h2><?php p('players_online'); ?>:</h2>
				<p><?php echo stats("players"); ?></p>
				<h2><?php p('total_troops'); ?>:</h2>
				<p><?php echo stats("troops"); ?></p>
				<h2><?php p('attacks'); ?>:</h2>
				<p><?php echo stats("attacks"); ?></p>
				<h2><?php p('returning'); ?>:</h2>
				<p><?php echo stats("returning"); ?></p>
				<h2><?php p('creating'); ?>:</h2>
				<p><?php echo stats("creating"); ?></p>
				<h2><?php p('building'); ?>:</h2>
				<p><?php echo stats("building"); ?></p>
			</div>
			<br />
			<div class=box>
				<h1>Noticias</h1>
				<h2>Aún estamos en pruebas</h2>
				<p>Próximamente se abrirán las inscripciones a The Tims</p>
			</div>
		</td>
		<td style="vertical-align:top" id="right_menu">
			<!-- FACEBOOK -->
			<?php facebook_widget(); ?>
			
			<br />	<br />
		
			<!-- TWITTER -->
			<?php twitter_widget(); ?>
		</td>
	</tr>
</table>
	
<div id="hora">
	<p><?php //echo date('l j \d\e F \d\e Y H:i');
		echo date('d/m/Y H:i'); ?></p>
</div>

<?php include 'ui/end.php'; ?>